package com.lw.question13;

/**
 * @author LW
 * @2020/10/19 11:43
 */
public class task3 {
    public static void main(String[] args) {
        int[] a={1,8,9,6,4,2,5,0,7,3};
        for (int i = 1; i < a.length; i++) {
                        int index = 0;
                    for (int j = 1; j <= a.length - i; j++) {
                             if (a[j] > a[index]) {
                                      index = j;
                               }
                         }
                       int temp = a[a.length - i];
                      a[a.length - i] = a[index];
                     a[index] = temp;

                 }
               for (int i : a) {
                  System.out.print(i + " ");

                 }
    }
}
